<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<head>

<style type="text/css">



  /* default css */
  
  table {
    font-size: 1em;
  }

  
  div, address, ol, ul, li, option, select { 
    margin-top: 0px;
    margin-bottom: 0px;
  }

  p {
    margin: 0px;
  }

  body {
    padding: 0px;
    
    
      margin: 0px;
    
  }

  h6 { font-size: 10pt }
  h5 { font-size: 11pt }
  h4 { font-size: 12pt }
  h3 { font-size: 13pt }
  h2 { font-size: 14pt }
  h1 { font-size: 16pt }

  blockquote {padding: 10px; border: 1px #DDD dashed }

  a img {border: 0}

  strike { text-decoration: line-through }

  div.google_header, div.google_footer {
    position: relative;
    margin-top: 1em;
    margin-bottom: 1em;
  }
  /* end default css */

  
    /* default print css */
    @media print {
      body { 
        padding: 0; 
        margin: 0; 
      }

      ol[type="a"] { list-style-type: lower-alpha }
      ol[type="A"] { list-style-type: upper-alpha }
      ol[type="i"] { list-style-type: lower-roman }
      ol[type="I"] { list-style-type: upper-roman }
    
      div.google_header, div.google_footer {
        display: block;
        min-height: 0;
        border: none;
      }

      div.google_header {
        flow: static(header);
      }

      /* used to insert page numbers */
      div.google_header::before, div.google_footer::before {
        position: absolute;
	top: 0;
      }

      div.google_footer {
        flow: static(footer);
      }

      /* always consider this element at the start of the doc */
      div#google_footer {
        flow: static(footer, start);
      }

      span.google_pagenumber {
        content: counter(page);
      }

      span.google_pagecount {
        content: counter(pages);
      }
    }

    @page {
      @top {
        content: flow(header);
      }
      @bottom {
        content: flow(footer);
      }
    }
    /* end default print css */
   
  
  /* custom css */
  
  
  /* end custom css */

  /* ui edited css */
  
  body {
    font-family: Verdana;
    
    font-size: 10.0pt;
    line-height: normal;
    background-color: #ffffff;
  }
  /* end ui edited css */


</style>
</head>


<body revision="dgtsd5n5_7cpb63k:15">

<h3>
  <b>Database Schema</b>
</h3>
You must create and populate the top six tables. Each is described below. Please
look at the demonstration database in the MySQL Query Browser in conjunction
with the descriptions.<br>
<br>
Once these six tables are complete, you run a java application, compile, that
creates the tables inside the box. The only one of these that you may be
interested in is user_actions, which records every request to the Bungee View
server.<br>
<br>
<b>Item</b><br>
<br>
There is one row for every item in your collection. The only required columns
are record_num and facet_names. Leave facet_names empty, and it will be filled
in by compile. record_num is a unique identifier.  If you want users to be able
to click on the thumbnail in the Selected Item frame to see more detail about
the item on your web site, each row must also have enough information to
construct its URL. The record_num might be enough, but in the demonstration
database there is an explicit URI column. There must also be columns for any
text that you want displayed under the thumbnail in the Selected Item frame.
Typical examples would be name, title, or description. These
should all be TEXT columns.<br>
<br style=FONT-WEIGHT:bold>
<b>Images</b><br>
<br>
Images are stored in a separate table for efficiency, but they are conceptually
part of the Item table. The record_num column links an image to its Item. w and
h are the width and height of the thumbnail image. If an item has no thumbnail,
you can leave it out of Images.  Usually you would let populate fill in this
table.<br>
<br style=FONT-WEIGHT:bold>
<b>Globals</b><br>
<br>
This table has only one row. Edit the initial values inserted by populate to fit
your collection.<br>
<ul>
  <li>
    description - a short description of the collection
  </li>
  <li>
    itemURL - a SQL expression to construct the URL to go to when users click on
    the thumbnail in the Selected Item frame. The expression is inserted in this
    query:<br>
    <br>
    SELECT &lt;itemURL&gt; FROM item WHERE record_num = ?;<br>
    <br>
    itemURL might be a column name, like URI, or it might be an expression like
    CONCAT('http:/myserver/mycollection/', record_num, '.html')
  </li>
  <li>
    itemURLdoc - the string to display when users hover over the thumbnail.
  </li>
  <li>
    genericObjectLabel - what you call the items in your collection.
  </li>
  <li>
    itemDescriptionFields - a comma-separated list of the fields in the item
    table that should be displayed below the thumbnail in the Selected Item
    frame.
  </li>
  <li>
    aboutURL - the URL to go to when users select "About this collection" in the
    Help menu.<br>
    <br style=FONT-WEIGHT:bold>
  </li>
</ul>
<b>Raw_facet_type</b><br>
<br>
This table describes the top-level tags in your meta-data. Usually there would
be 5-10 rows in this table.<br>
<ul>
  <li>
    facet_type_id - a unique identifier<br>
  </li>
</ul>
<ul>
  <li>
    name - the name of the tag
  </li>
  <li>
    descriptionCategory &amp; descriptionPreposition - these control how Bungee
    View constructs the sentence describing the current Search.<br>
  </li>
  <ul>
    <li>
      Use descriptionCategory = "<b>object</b>" for the tag that tells what the
      item is, for example Medium. This will produce "... for &lt;medium&gt;s
      that ..."<br>
      descriptionPreposition is ignored in this case. objects will come first in
      the sentence.<br>
    </li>
    <li>
      Use descriptionCategory = "<b>meta</b>" for tags that should come next in
      the sentence, and "<b>content</b>" for tags that should come last.
      descriptionPreposition is a pattern into which the tag name is substituted
      for '~'. If it doesn't contain '~' [descriptionPreposition ~, NOT
      descriptionPreposition ~] is used.
    </li>
  </ul>
  <li>
    sort - determines the order in which tag categories are displayed. Tag categories
    whose sort is negative are not displayed.
  </li>
  <li>
    isOrdered = 1 if the tag category has a natural order, for example Date.
    Otherwise 0. For ordered tag categories, median values are shown with an
    arrow below the bars.
  </li>
</ul>
<br>
<b>Raw_facet</b><br>
<br>
<ul>
  <li>
    facet_id - a unique identifier. Should not overlap with facet_type_id in the
    facet_type table. You might want to use 1-100 for facet_type_ids, and 1001
    and above for facet_ids.<br>
  </li>
  <li>
    parent_facet_id - the facet_id of the parent tag, or if the parent is a
    facet_type, the facet_type_id. For instance the parent of "1903" is "20th
    century", whose parent is "Date".<br>
  </li>
  <li>
    name - the name to display for the tag
  </li>
  <li>
    sort - a column of any MySQL data type used to order the bars in the Search
    frame. Ties are broken using name, so if you leave it null tags are
    displayed alphabetically.<br>
  </li>
</ul>
<br>
<b>Raw_item_facet</b><br>
<br>
This table links items to the tags that describe them.<br>
<br>
<ul>
  <li>
    record_num - the item
  </li>
  <li>
    facet_id - the tag that describes the item<br>
  </li>
</ul>
<br>
<b>User_actions</b><br>
<br>
You don't have to create or update this table. compile creates it, and Bungee
View updates it.<br>
<br>
<ul>
  <li>
    timestamp - when the user made the request
  </li>
  <li>
    session - a unique identifier for the client session. There is a new session
    each time Bungee View is started, or when a user changes databases from
    within Bungee View.
  </li>

  <li>
    location, object, &amp; modifiers - describe the users action, for instance
    clicking on a bar or image, typing a search keyword, or using a menu.
  </li>
  <li>
    client - the IP address of the client<br>
  </li>
</ul>
<br>
This is enough information to play back the session, by invoking Bungee View
with a URL like this:<br>
<br>
http://cityscape.inf.cs.cmu.edu/bungee/bungee.jsp?db=wpa&amp;session=SESSION<br>
<br>
(Substitute the session ID for SESSION.)<br>
<br>
There should also be a way to print a session in a more human-readable way, but
that hasn't been done yet.<br>
<br>
<br>
<div id=et5u style="PADDING:1em 0pt; TEXT-ALIGN:left">
  <img src=schema.png style="WIDTH:840px; HEIGHT:1040px">
</div>
<b><br>
</b></body>
</html>
